using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlTypes;
using System.Diagnostics;
using System.Globalization;
namespace Fcdbas.Core
{
	[System.Diagnostics.DebuggerDisplay("{Value}")]
	[System.Serializable]
	public struct SalNumber : System.IComparable, System.IConvertible, System.IFormattable, INullable, ISalType
	{
		[Browsable(false), System.Diagnostics.DebuggerStepThrough, System.Obsolete("Replaced by SalArray<T>.")]
		[System.Serializable]
		public class Array : SalArray<SalNumber>
		{
			public Array()
			{
			}
			public Array(params int[] elems) : base(elems)
			{
			}
			public Array(params string[] elems) : base(elems)
			{
			}
			protected override object CreateInstance()
			{
				return SalNumber.Zero;
			}
		}
		internal const string DefaultFormat = "0.#############################";
		private const decimal Int32MinValue = -2147483648m;
		private const decimal Int32MaxValue = 2147483647m;
		public static readonly SalNumber Null = new SalNumber(System.DBNull.Value);
		public static readonly SalNumber Zero = new SalNumber(0m);
		public static readonly SalNumber One = new SalNumber(1m);
		public static readonly SalNumber MinusOne = new SalNumber(-1m);
		private static System.Random m_random;
		private decimal m_value;
		private bool m_isNull;
		public bool IsNull
		{
			[System.Diagnostics.DebuggerStepThrough]
			get
			{
				return this.m_isNull;
			}
		}
		public decimal Value
		{
			[System.Diagnostics.DebuggerStepThrough]
			get
			{
				return this.m_value;
			}
		}
		DbType ISalType.DbType
		{
			get
			{
				return DbType.Decimal;
			}
		}
		object ISalType.Value
		{
			get
			{
				if (this.IsNull)
				{
					return System.DBNull.Value;
				}
				return this.Value;
			}
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(decimal x)
		{
			this.m_value = x;
			this.m_isNull = false;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(double x)
		{
			try
			{
				this.m_value = (decimal)x;
				this.m_isNull = false;
			}
			catch (System.OverflowException e)
			{
				Sys.TraceException(Sys.TraceSystem, e, TraceLevel.Warning);
				this.m_value = 0m;
				this.m_isNull = true;
			}
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(float x)
		{
			try
			{
				this.m_value = (decimal)x;
				this.m_isNull = false;
			}
			catch (System.OverflowException e)
			{
				Sys.TraceException(Sys.TraceSystem, e, TraceLevel.Warning);
				this.m_value = 0m;
				this.m_isNull = true;
			}
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(int x)
		{
			this.m_value = x;
			this.m_isNull = false;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(uint x)
		{
			this.m_value = x;
			this.m_isNull = false;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(long x)
		{
			this.m_value = x;
			this.m_isNull = false;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(ulong x)
		{
			this.m_value = x;
			this.m_isNull = false;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(short x)
		{
			this.m_value = x;
			this.m_isNull = false;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(ushort x)
		{
			this.m_value = x;
			this.m_isNull = false;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(char x)
		{
			this.m_value = x;
			this.m_isNull = false;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(byte x)
		{
			this.m_value = x;
			this.m_isNull = false;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(bool x)
		{
			this.m_value = (x ? 1m : 0m);
			this.m_isNull = false;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(System.Enum x)
		{
			this.m_value = System.Convert.ToDecimal(x);
			this.m_isNull = false;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalNumber(System.IntPtr x)
		{
			this.m_value = ((System.IntPtr.Size == 4) ? ((long)x.ToInt32()) : x.ToInt64());
			this.m_isNull = false;
		}
		[System.Diagnostics.DebuggerStepThrough]
		internal SalNumber(SalBoolean b)
		{
			this.m_value = b.Value;
			this.m_isNull = b.IsNull;
		}
		[System.Diagnostics.DebuggerStepThrough]
		private SalNumber(System.DBNull x)
		{
			this.m_value = 0m;
			this.m_isNull = true;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator decimal(SalNumber x)
		{
			return x.ToDecimal();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator int(SalNumber x)
		{
			return x.ToInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator double(SalNumber x)
		{
			return x.ToDouble();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator float(SalNumber x)
		{
			return x.ToSingle();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator System.IntPtr(SalNumber x)
		{
			return new System.IntPtr((System.IntPtr.Size == 4) ? ((long)x.ToInt32()) : x.ToInt64());
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static explicit operator uint(SalNumber x)
		{
			return x.ToUInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static explicit operator long(SalNumber x)
		{
			return x.ToInt64();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static explicit operator ulong(SalNumber x)
		{
			return x.ToUInt64();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static explicit operator char(SalNumber x)
		{
			return x.ToChar();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static explicit operator short(SalNumber x)
		{
			return x.ToInt16();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static explicit operator ushort(SalNumber x)
		{
			return x.ToUInt16();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static explicit operator byte(SalNumber x)
		{
			return x.ToByte();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public decimal ToDecimal()
		{
			return this.m_value;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public double ToDouble()
		{
			return decimal.ToDouble(this.m_value);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public float ToSingle()
		{
			return decimal.ToSingle(this.m_value);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public long ToInt64()
		{
			return decimal.ToInt64(this.m_value);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public int ToInt32()
		{
			if (decimal.Compare(this.m_value, 2147483647m) > 0)
			{
				int num = decimal.GetBits(decimal.Truncate(this.m_value))[0];
				Sys.TraceWarning(Sys.TraceSystem, "Value truncation: {0} is truncated to {1}", new object[]
				{
					this.m_value,
					num
				});
				return num;
			}
			if (decimal.Compare(this.m_value, -2147483648m) < 0)
			{
				int num2 = -decimal.GetBits(decimal.Truncate(this.m_value))[0];
				Sys.TraceWarning(Sys.TraceSystem, "Value truncation: {0} is truncated to {1}", new object[]
				{
					this.m_value,
					num2
				});
				return num2;
			}
			return decimal.ToInt32(this.m_value);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public System.IntPtr ToIntPtr()
		{
			return new System.IntPtr((System.IntPtr.Size == 4) ? ((long)this.ToInt32()) : this.ToInt64());
		}
		[System.Diagnostics.DebuggerStepThrough]
		public short ToInt16()
		{
			return (short)this.ToInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public char ToChar()
		{
			return (char)this.ToInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public byte ToByte()
		{
			return (byte)this.ToInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public ulong ToUInt64()
		{
			return decimal.ToUInt64(this.m_value);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public uint ToUInt32()
		{
			return (uint)this.ToInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public ushort ToUInt16()
		{
			return (ushort)this.ToInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public sbyte ToSByte()
		{
			return (sbyte)this.ToInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public bool ToBoolean()
		{
			return decimal.Compare(this.m_value, 0m) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(SalBoolean x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(System.DBNull x)
		{
			return SalNumber.Null;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(decimal x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(double x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(float x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(int x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(uint x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(bool x)
		{
			return new SalNumber(x);
		}
		public static implicit operator SalNumber(System.Enum x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(System.IntPtr x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(long x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(ulong x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(short x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(ushort x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(byte x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator SalNumber(char x)
		{
			return new SalNumber(x);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber Add(SalNumber x, SalNumber y)
		{
			return new SalNumber(decimal.Add(x.m_value, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(SalNumber x, SalNumber y)
		{
			return new SalNumber(decimal.Add(x.m_value, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(SalBoolean x, SalNumber y)
		{
			return new SalNumber(decimal.Add(x.Value, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(SalNumber x, SalBoolean y)
		{
			return new SalNumber(decimal.Add(x.m_value, y.Value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(decimal x, SalNumber y)
		{
			return new SalNumber(decimal.Add(x, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(SalNumber x, decimal y)
		{
			return new SalNumber(decimal.Add(x.m_value, y));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(double x, SalNumber y)
		{
			return new SalNumber(decimal.Add(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(SalNumber x, double y)
		{
			return new SalNumber(decimal.Add(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(float x, SalNumber y)
		{
			return new SalNumber(decimal.Add(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(SalNumber x, float y)
		{
			return new SalNumber(decimal.Add(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(long x, SalNumber y)
		{
			return new SalNumber(decimal.Add(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(SalNumber x, long y)
		{
			return new SalNumber(decimal.Add(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(ulong x, SalNumber y)
		{
			return new SalNumber(decimal.Add(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(SalNumber x, ulong y)
		{
			return new SalNumber(decimal.Add(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(int x, SalNumber y)
		{
			return new SalNumber(decimal.Add(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(SalNumber x, int y)
		{
			return new SalNumber(decimal.Add(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(uint x, SalNumber y)
		{
			return new SalNumber(decimal.Add(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(SalNumber x, uint y)
		{
			return new SalNumber(decimal.Add(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber Subtract(SalNumber x, SalNumber y)
		{
			return new SalNumber(decimal.Subtract(x.m_value, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(SalNumber x, SalNumber y)
		{
			return new SalNumber(decimal.Subtract(x.m_value, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(SalBoolean x, SalNumber y)
		{
			return new SalNumber(decimal.Subtract(x.Value, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(SalNumber x, SalBoolean y)
		{
			return new SalNumber(decimal.Subtract(x.m_value, y.Value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(decimal x, SalNumber y)
		{
			return new SalNumber(decimal.Subtract(x, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(SalNumber x, decimal y)
		{
			return new SalNumber(decimal.Subtract(x.m_value, y));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(double x, SalNumber y)
		{
			return new SalNumber(decimal.Subtract(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(SalNumber x, double y)
		{
			return new SalNumber(decimal.Subtract(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(float x, SalNumber y)
		{
			return new SalNumber(decimal.Subtract(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(SalNumber x, float y)
		{
			return new SalNumber(decimal.Subtract(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(long x, SalNumber y)
		{
			return new SalNumber(decimal.Subtract(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(SalNumber x, long y)
		{
			return new SalNumber(decimal.Subtract(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(ulong x, SalNumber y)
		{
			return new SalNumber(decimal.Subtract(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(SalNumber x, ulong y)
		{
			return new SalNumber(decimal.Subtract(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(int x, SalNumber y)
		{
			return new SalNumber(decimal.Subtract(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(SalNumber x, int y)
		{
			return new SalNumber(decimal.Subtract(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(uint x, SalNumber y)
		{
			return new SalNumber(decimal.Subtract(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(SalNumber x, uint y)
		{
			return new SalNumber(decimal.Subtract(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber Multiply(SalNumber x, SalNumber y)
		{
			return new SalNumber(decimal.Multiply(x.m_value, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(SalNumber x, SalNumber y)
		{
			return new SalNumber(decimal.Multiply(x.m_value, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(SalBoolean x, SalNumber y)
		{
			return new SalNumber(decimal.Multiply(x.Value, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(SalNumber x, SalBoolean y)
		{
			return new SalNumber(decimal.Multiply(x.m_value, y.Value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(decimal x, SalNumber y)
		{
			return new SalNumber(decimal.Multiply(x, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(SalNumber x, decimal y)
		{
			return new SalNumber(decimal.Multiply(x.m_value, y));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(double x, SalNumber y)
		{
			return new SalNumber(decimal.Multiply(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(SalNumber x, double y)
		{
			return new SalNumber(decimal.Multiply(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(float x, SalNumber y)
		{
			return new SalNumber(decimal.Multiply(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(SalNumber x, float y)
		{
			return new SalNumber(decimal.Multiply(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(long x, SalNumber y)
		{
			return new SalNumber(decimal.Multiply(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(SalNumber x, long y)
		{
			return new SalNumber(decimal.Multiply(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(ulong x, SalNumber y)
		{
			return new SalNumber(decimal.Multiply(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(SalNumber x, ulong y)
		{
			return new SalNumber(decimal.Multiply(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(int x, SalNumber y)
		{
			return new SalNumber(decimal.Multiply(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(SalNumber x, int y)
		{
			return new SalNumber(decimal.Multiply(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(uint x, SalNumber y)
		{
			return new SalNumber(decimal.Multiply(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator *(SalNumber x, uint y)
		{
			return new SalNumber(decimal.Multiply(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber Divide(SalNumber x, SalNumber y)
		{
			return new SalNumber(decimal.Divide(x.m_value, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(SalNumber x, SalNumber y)
		{
			return new SalNumber(decimal.Divide(x.m_value, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(SalBoolean x, SalNumber y)
		{
			return new SalNumber(decimal.Divide(x.Value, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(SalNumber x, SalBoolean y)
		{
			return new SalNumber(decimal.Divide(x.m_value, y.Value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(decimal x, SalNumber y)
		{
			return new SalNumber(decimal.Divide(x, y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(SalNumber x, decimal y)
		{
			return new SalNumber(decimal.Divide(x.m_value, y));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(double x, SalNumber y)
		{
			return new SalNumber(decimal.Divide(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(SalNumber x, double y)
		{
			return new SalNumber(decimal.Divide(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(float x, SalNumber y)
		{
			return new SalNumber(decimal.Divide(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(SalNumber x, float y)
		{
			return new SalNumber(decimal.Divide(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(long x, SalNumber y)
		{
			return new SalNumber(decimal.Divide(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(SalNumber x, long y)
		{
			return new SalNumber(decimal.Divide(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(ulong x, SalNumber y)
		{
			return new SalNumber(decimal.Divide(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(SalNumber x, ulong y)
		{
			return new SalNumber(decimal.Divide(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(int x, SalNumber y)
		{
			return new SalNumber(decimal.Divide(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(SalNumber x, int y)
		{
			return new SalNumber(decimal.Divide(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(uint x, SalNumber y)
		{
			return new SalNumber(decimal.Divide(new decimal(x), y.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator /(SalNumber x, uint y)
		{
			return new SalNumber(decimal.Divide(x.m_value, new decimal(y)));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator ++(SalNumber x)
		{
			return new SalNumber(decimal.Add(x.m_value, 1m));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator --(SalNumber x)
		{
			return new SalNumber(decimal.Subtract(x.m_value, 1m));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber Negate(SalNumber x)
		{
			if (x.IsNull)
			{
				return SalNumber.Null;
			}
			return new SalNumber(decimal.Negate(x.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator -(SalNumber x)
		{
			if (x.IsNull)
			{
				return SalNumber.Null;
			}
			return new SalNumber(decimal.Negate(x.m_value));
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator +(SalNumber x)
		{
			return x;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static int Compare(SalNumber x, SalNumber y)
		{
			if (x.IsNull)
			{
				if (!y.IsNull)
				{
					return -1;
				}
				return 0;
			}
			else
			{
				if (y.IsNull)
				{
					return 1;
				}
				return decimal.Compare(x.m_value, y.m_value);
			}
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(SalNumber x, SalNumber y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(SalNumber x, SalBoolean y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(SalBoolean x, SalNumber y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(decimal x, SalNumber y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(SalNumber x, decimal y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(double x, SalNumber y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(SalNumber x, double y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(float x, SalNumber y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(SalNumber x, float y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(long x, SalNumber y)
		{
			return SalNumber.Compare(new SalNumber(x), y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(ulong x, SalNumber y)
		{
			return SalNumber.Compare(new SalNumber(x), y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(SalNumber x, long y)
		{
			return SalNumber.Compare(x, new SalNumber(y)) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(SalNumber x, ulong y)
		{
			return SalNumber.Compare(x, new SalNumber(y)) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(int x, SalNumber y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(SalNumber x, int y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(uint x, SalNumber y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(SalNumber x, uint y)
		{
			return SalNumber.Compare(x, y) == 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(bool x, SalNumber y)
		{
			return !y.IsNull && x == y.ToBoolean();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator ==(SalNumber x, bool y)
		{
			return !x.IsNull && x.ToBoolean() == y;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(SalNumber x, SalNumber y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(SalNumber x, SalBoolean y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(SalBoolean x, SalNumber y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(decimal x, SalNumber y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(SalNumber x, decimal y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(double x, SalNumber y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(SalNumber x, double y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(float x, SalNumber y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(SalNumber x, float y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(long x, SalNumber y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(ulong x, SalNumber y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(SalNumber x, long y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(SalNumber x, ulong y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(int x, SalNumber y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(SalNumber x, int y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(uint x, SalNumber y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(SalNumber x, uint y)
		{
			return SalNumber.Compare(x, y) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(bool x, SalNumber y)
		{
			return y.IsNull || x != y.ToBoolean();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !=(SalNumber x, bool y)
		{
			return x.IsNull || x.ToBoolean() != y;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(SalNumber x, SalNumber y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(SalNumber x, SalBoolean y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(SalBoolean x, SalNumber y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(decimal x, SalNumber y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(SalNumber x, decimal y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(double x, SalNumber y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(SalNumber x, double y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(float x, SalNumber y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(SalNumber x, float y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(long x, SalNumber y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(SalNumber x, long y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(SalNumber x, ulong y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(ulong x, SalNumber y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(int x, SalNumber y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(SalNumber x, int y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(uint x, SalNumber y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >(SalNumber x, uint y)
		{
			return SalNumber.Compare(x, y) > 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(SalNumber x, SalNumber y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(SalNumber x, SalBoolean y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(SalBoolean x, SalNumber y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(decimal x, SalNumber y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(SalNumber x, decimal y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(double x, SalNumber y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(SalNumber x, double y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(float x, SalNumber y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(SalNumber x, float y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(long x, SalNumber y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(SalNumber x, long y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(ulong x, SalNumber y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(SalNumber x, ulong y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(int x, SalNumber y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(SalNumber x, int y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(uint x, SalNumber y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <(SalNumber x, uint y)
		{
			return SalNumber.Compare(x, y) < 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(SalNumber x, SalNumber y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(SalNumber x, SalBoolean y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(SalBoolean x, SalNumber y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(decimal x, SalNumber y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(SalNumber x, decimal y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(double x, SalNumber y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(SalNumber x, double y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(float x, SalNumber y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(SalNumber x, float y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(long x, SalNumber y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(SalNumber x, long y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(ulong x, SalNumber y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(SalNumber x, ulong y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(int x, SalNumber y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(SalNumber x, int y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(uint x, SalNumber y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator >=(SalNumber x, uint y)
		{
			return SalNumber.Compare(x, y) >= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(SalNumber x, SalNumber y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(SalNumber x, SalBoolean y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(SalBoolean x, SalNumber y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(decimal x, SalNumber y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(SalNumber x, decimal y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(double x, SalNumber y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(SalNumber x, double y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(float x, SalNumber y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(SalNumber x, float y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(long x, SalNumber y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(SalNumber x, long y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(ulong x, SalNumber y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(SalNumber x, ulong y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(int x, SalNumber y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(SalNumber x, int y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(uint x, SalNumber y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator <=(SalNumber x, uint y)
		{
			return SalNumber.Compare(x, y) <= 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator &(SalNumber x, SalNumber y)
		{
			return x.ToUInt32() & y.ToUInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator &(SalNumber x, SalBoolean y)
		{
			return x.ToUInt32() & y.ToUInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator &(SalBoolean x, SalNumber y)
		{
			return x.ToUInt32() & y.ToUInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator &(SalNumber x, bool y)
		{
			return x.ToBoolean() & y;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator &(SalNumber x, int y)
		{
			return x.ToInt32() & y;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator &(SalNumber x, uint y)
		{
			return x.ToUInt32() & y;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator &(SalNumber x, long y)
		{
			return x.ToInt64() & y;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator &(SalNumber x, ulong y)
		{
			return x.ToUInt64() & y;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator &(int x, SalNumber y)
		{
			return x & y.ToInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator &(uint x, SalNumber y)
		{
			return x & y.ToUInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator &(long x, SalNumber y)
		{
			return x & y.ToInt64();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator &(ulong x, SalNumber y)
		{
			return x & y.ToUInt64();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator |(SalNumber x, SalNumber y)
		{
			return x.ToUInt32() | y.ToUInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator |(SalNumber x, SalBoolean y)
		{
			return x.ToUInt32() | y.ToUInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator |(SalBoolean x, SalNumber y)
		{
			return x.ToUInt32() | y.ToUInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator |(SalNumber x, bool y)
		{
			return x.ToBoolean() | y;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator |(SalNumber x, int y)
		{
			return x.ToInt32() | y;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator |(SalNumber x, uint y)
		{
			return x.ToUInt32() | y;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator |(SalNumber x, long y)
		{
			return x.ToInt64() | y;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator |(SalNumber x, ulong y)
		{
			return x.ToUInt64() | y;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator |(int x, SalNumber y)
		{
			return x | y.ToInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator |(uint x, SalNumber y)
		{
			return x | y.ToUInt32();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator |(long x, SalNumber y)
		{
			return x | y.ToInt64();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static SalNumber operator |(ulong x, SalNumber y)
		{
			return x | y.ToUInt64();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static implicit operator bool(SalNumber x)
		{
			return decimal.Compare(x.m_value, 0m) != 0;
		}
		[System.Diagnostics.DebuggerStepThrough]
		public static bool operator !(SalNumber x)
		{
			return decimal.Compare(x.m_value, 0m) == 0;
		}
		public override bool Equals(object obj)
		{
			if (obj is SalNumber)
			{
				return SalNumber.Compare(this, (SalNumber)obj) == 0;
			}
			return decimal.Compare(this.m_value, System.Convert.ToDecimal(obj)) == 0;
		}
		public override int GetHashCode()
		{
			return this.m_value.GetHashCode();
		}
		[System.Diagnostics.DebuggerStepThrough]
		public override string ToString()
		{
			return ((System.IConvertible)this).ToString(null);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalString ToString(System.IFormatProvider provider)
		{
			return ((System.IFormattable)this).ToString(null, provider);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalString ToString(string format)
		{
			return ((System.IFormattable)this).ToString(format, null);
		}
		[System.Diagnostics.DebuggerStepThrough]
		public SalString ToString(string format, System.IFormatProvider provider)
		{
			return ((System.IFormattable)this).ToString(format, provider);
		}
		public SalNumber Abs()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			return System.Math.Abs(this.m_value);
		}
		public SalNumber ArcCos()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			try
			{
				return System.Math.Acos(this);
			}
			catch (System.OverflowException)
			{
			}
			return SalNumber.Null;
		}
		public SalNumber ArcSin()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			try
			{
				return System.Math.Asin(this);
			}
			catch (System.OverflowException)
			{
			}
			return SalNumber.Null;
		}
		public SalNumber ArcTan()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			try
			{
				return System.Math.Atan(this);
			}
			catch (System.OverflowException)
			{
			}
			return SalNumber.Null;
		}
		public static SalNumber ArcTan2(SalNumber nm_valueY, SalNumber nm_valueX)
		{
			if (nm_valueX.IsNull || nm_valueY.IsNull)
			{
				return SalNumber.Null;
			}
			try
			{
				return System.Math.Atan2(nm_valueY, nm_valueX);
			}
			catch (System.OverflowException)
			{
			}
			return SalNumber.Null;
		}
		public SalNumber Cos()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			try
			{
				return System.Math.Cos(this);
			}
			catch (System.OverflowException)
			{
			}
			return SalNumber.Null;
		}
		public SalNumber CosH()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			try
			{
				return System.Math.Cosh(this);
			}
			catch (System.OverflowException)
			{
			}
			return SalNumber.Null;
		}
		public SalNumber Exponent()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			try
			{
				return System.Math.Exp(this);
			}
			catch (System.OverflowException)
			{
			}
			return SalNumber.Null;
		}
		public SalNumber HighWord()
		{
			return (uint)this >> 16;
		}
		public static SalNumber Hypot(SalNumber nX, SalNumber nY)
		{
			if (nX.IsNull || nY.IsNull)
			{
				return SalNumber.Null;
			}
			return System.Math.Sqrt(nX * nX + nY * nY);
		}
		public SalNumber Log()
		{
			if (this.m_value <= 0m)
			{
				return SalNumber.Null;
			}
			return System.Math.Log(this);
		}
		public SalNumber LogBase10()
		{
			if (this.m_value <= 0m)
			{
				return SalNumber.Null;
			}
			return System.Math.Log10(this);
		}
		public SalNumber LowWord()
		{
			return (uint)this & 65535u;
		}
		public static SalNumber Max(SalNumber x, SalNumber y)
		{
			if (x.IsNull)
			{
				return y;
			}
			if (y.IsNull)
			{
				return x;
			}
			return System.Math.Max(x.m_value, y.m_value);
		}
		public static SalNumber Min(SalNumber x, SalNumber y)
		{
			if (x.IsNull)
			{
				return x;
			}
			if (y.IsNull)
			{
				return y;
			}
			return System.Math.Min(x.m_value, y.m_value);
		}
		public SalNumber Mod(SalNumber nDividend)
		{
			if (this.IsNull)
			{
				return SalNumber.Zero;
			}
			if (nDividend.IsNull || nDividend == SalNumber.Zero)
			{
				return this;
			}
			return this.m_value % nDividend.m_value;
		}
		public SalNumber Pi()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			return 3.14159265358979m * this.m_value;
		}
		public SalNumber Power(SalNumber nPower)
		{
			if (this.IsNull || nPower.IsNull)
			{
				return SalNumber.Null;
			}
			return System.Math.Pow((double)this.m_value, nPower);
		}
		public static bool RandInit(int seed)
		{
			SalNumber.m_random = new System.Random(seed);
			return true;
		}
		public static SalNumber Random()
		{
			lock (typeof(SalNumber))
			{
				if (SalNumber.m_random == null)
				{
					SalNumber.m_random = new System.Random();
				}
			}
			return SalNumber.m_random.Next(0, 32767);
		}
		public SalNumber Round()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			return decimal.Floor(this.m_value + 0.5m);
		}
		public SalNumber Sin()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			return System.Math.Sin(this);
		}
		public SalNumber SinH()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			return System.Math.Sinh(this);
		}
		public SalNumber Sqrt()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			return System.Math.Sqrt(this);
		}
		public SalNumber Tan()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			return System.Math.Tan(this);
		}
		public SalNumber TanH()
		{
			if (this.IsNull)
			{
				return SalNumber.Null;
			}
			return System.Math.Tanh(this);
		}
		public SalString ToString(int decimals)
		{
			if (this.IsNull)
			{
				return string.Empty;
			}
			System.Globalization.NumberFormatInfo numberFormatInfo = (System.Globalization.NumberFormatInfo)System.Globalization.NumberFormatInfo.CurrentInfo.Clone();
			numberFormatInfo.NumberGroupSeparator = string.Empty;
			numberFormatInfo.NumberDecimalDigits = System.Math.Max(0, decimals);
			return this.m_value.ToString("N", numberFormatInfo);
		}
		public SalNumber ToString(int decimals, ref SalString target)
		{
			target = this.ToString(decimals);
			return target.Length;
		}
		public SalNumber Truncate(int precision, int scale)
		{
			if (this.IsNull || precision < 0 || scale < 0)
			{
				return SalNumber.Null;
			}
			long value = (long)System.Math.Pow(10.0, (double)scale);
			long num = (long)System.Math.Pow(10.0, (double)precision);
			long num2 = (long)(this.m_value * value);
			long num3 = num2 / num * num;
			decimal x = (num2 - num3) / value;
			return x;
		}
		public SalWindowHandle ToWindowHandle()
		{
			return new SalWindowHandle(this.ToIntPtr());
		}
		public SalString ToCharacter()
		{
			char c = this.ToChar();
			if (c == '\0')
			{
				return SalString.Empty;
			}
			return new string(c, 1);
		}
		public int CompareTo(object obj)
		{
			if (obj is SalNumber)
			{
				return this.CompareTo((SalNumber)obj);
			}
			return this.m_value.CompareTo(obj);
		}
		public int CompareTo(SalNumber x)
		{
			return SalNumber.Compare(this, x);
		}
		ulong System.IConvertible.ToUInt64(System.IFormatProvider provider)
		{
			return this.ToUInt64();
		}
		sbyte System.IConvertible.ToSByte(System.IFormatProvider provider)
		{
			return this.ToSByte();
		}
		double System.IConvertible.ToDouble(System.IFormatProvider provider)
		{
			return this.ToDouble();
		}
		System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider provider)
		{
			return System.Convert.ToDateTime(this.m_value);
		}
		float System.IConvertible.ToSingle(System.IFormatProvider provider)
		{
			return this.ToSingle();
		}
		bool System.IConvertible.ToBoolean(System.IFormatProvider provider)
		{
			return this.ToBoolean();
		}
		int System.IConvertible.ToInt32(System.IFormatProvider provider)
		{
			return this.ToInt32();
		}
		ushort System.IConvertible.ToUInt16(System.IFormatProvider provider)
		{
			return this.ToUInt16();
		}
		short System.IConvertible.ToInt16(System.IFormatProvider provider)
		{
			return this.ToInt16();
		}
		byte System.IConvertible.ToByte(System.IFormatProvider provider)
		{
			return this.ToByte();
		}
		char System.IConvertible.ToChar(System.IFormatProvider provider)
		{
			return this.ToChar();
		}
		long System.IConvertible.ToInt64(System.IFormatProvider provider)
		{
			return this.ToInt64();
		}
		uint System.IConvertible.ToUInt32(System.IFormatProvider provider)
		{
			return this.ToUInt32();
		}
		decimal System.IConvertible.ToDecimal(System.IFormatProvider provider)
		{
			return this.ToDecimal();
		}
		System.TypeCode System.IConvertible.GetTypeCode()
		{
			return System.TypeCode.Decimal;
		}
		object System.IConvertible.ToType(System.Type targetType, System.IFormatProvider provider)
		{
			if (targetType == typeof(SalNumber))
			{
				return this;
			}
			return ((System.IConvertible)this.m_value).ToType(targetType, provider);
		}
		string System.IConvertible.ToString(System.IFormatProvider provider)
		{
			return ((System.IFormattable)this).ToString(null, provider);
		}
		string System.IFormattable.ToString(string format, System.IFormatProvider provider)
		{
			if (this.IsNull)
			{
				return string.Empty;
			}
			if (format == null || format.Length == 0)
			{
				format = "0.#############################";
			}
			string result;
			try
			{
				result = this.m_value.ToString(format, provider);
			}
			catch (System.FormatException)
			{
				result = string.Empty;
			}
			return result;
		}
	}
}
